#include "ccurvedata.h"

CCurveData::CCurveData()
    :m_strLegend(("Curve_A"))
    ,m_nLineType(0)
    ,m_nLineWidth(2)
    ,m_clrLineColor( QColor(0,0,0))
    //,m_clrMarkColor( QColor(0,0,0))
    //,m_eMarkType(M_Circle)
{

}

CCurveData::CCurveData(QList<float> pxValue, QList<float> pyValue, QString strLegend)
    :m_strLegend(strLegend)
    ,m_nLineType(0)
    ,m_nLineWidth(2)
    ,m_clrLineColor( QColor(0,0,0))
    //,m_clrMarkColor( QColor(0,0,0))
    //,m_eMarkType(M_Circle)
{
    m_pXValue = pxValue;
    m_pYValue = pyValue;
}

CCurveData::~CCurveData()
{

}

void CCurveData::SetLineColor(QColor color)
{
    m_clrLineColor = color;
}

QColor CCurveData::GetLineColor()
{
    return m_clrLineColor;
}

//void CCurveData::SetMarkColor(QColor color)
//{
//    m_clrMarkColor = color;
//}

//QColor CCurveData::GetMarkColor()
//{
//    return m_clrMarkColor;
//;
//}

void CCurveData::SetLineWidth(int nWidth)
{
    m_nLineWidth = nWidth;
}

int CCurveData::GetLineWidth()
{
    return m_nLineWidth;
}

void CCurveData::SetLineType(int nType)
{
    m_nLineType = nType;
}

int CCurveData::GetLineType()
{
    return m_nLineType;
}

//void CCurveData::SetMarkType(CCurveData::MarkType type)
//{
//    m_eMarkType = type;
//}

//CCurveData::MarkType CCurveData::GetMarkType()
//{
//    return m_eMarkType;
//}

bool CCurveData::SetData(QList<float> xValue, QList<float> yValue)
{
    m_pXValue = xValue;
    m_pYValue = yValue;
    return true;
}

QList<float> CCurveData::GetData(QString axisName)
{
    if(axisName.contains("X",Qt::CaseInsensitive))
    {
        return  m_pXValue;
    }
    else
    {
        return m_pYValue;
    }
}

void CCurveData::ShowMark(bool isShow)
{
    m_bIsShowMark = isShow;
}

//void CCurveData::ShowLine(bool isShow)
//{
//    m_bisShowLine = isShow;
//}

QString CCurveData::GetCurveName()
{
    return m_strLegend;
}

void CCurveData::SetCurveName(QString strLegend)
{
    m_strLegend = strLegend;
}
